package com.wry.es.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <h1>  <h1>
 *
 * @author wry
 * @since 2024/9/14 14:22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ApiResult<T> implements Serializable {

    private T data;

    private Long code;

    public static ApiResult<String> ok() {
        return new ApiResult<>("ok", 200L);
    }

    public static <T>ApiResult<T> success(T data) {
        return new ApiResult<>(data, 200L);
    }
}
